#pragma once
#pragma comment( lib, "strsafe.lib" )

#include "strsafe.h"
#include "Singleton.h"

#define	EVENT_HOOKER_DLL_NAME	_T( "EventHooker.DLL" )

#define ARRAY_SIZE				1024

#define MENUID_SEPARATOR		100
#define MENUID_UNTRAY_ALL		101
#define MENUID_ABOUT_DLG		102
#define MENUID_EXIT				103

#define MENUID_APPNAMES			200
#define HOT_KEY_ID				46000

const UINT WM_TRAY_ICON_NOTIFY_MESSAGE = ::RegisterWindowMessage( _T( "VODAS_TRAY_NOTIRY_MESSAGE" ) );

typedef BOOL ( * fpInstallHook				)( VOID										);
typedef BOOL ( * fpMouseHook				)( VOID										);
typedef BOOL ( * fpUnInstallHook			)( VOID										);
typedef VOID ( * fpUnTrayAll				)( VOID										);
typedef UINT ( * fpGetTrayMessageID			)( VOID										);
typedef VOID ( * fpGetMinimizedWinodwList	)( TCHAR	szParam[ ARRAY_SIZE ][ 100 ]	);
typedef BOOL ( * fpUnTrayMe					)( TCHAR *	szTitile						);

class CEventHookerWraper : public Singleton< CEventHookerWraper >
{
	public	:
		
				CEventHookerWraper( VOID );
		virtual	~CEventHookerWraper( VOID );

		BOOL	Initialize( VOID );
		VOID	CleanUp(VOID );

		//	EventHook Wraper Functions.
		BOOL	InstallHook(				VOID									);
		BOOL	MouseHook(					VOID									);
		BOOL	UnInstallHook(				VOID									);
		VOID	UnTrayAll(					VOID									);
		UINT	GetTrayMessageID(			VOID									);
		VOID	GetMinimizedWindowsList(	TCHAR	szParam[ ARRAY_SIZE ][ 100 ]	);
		BOOL	UnTrayMe(					TCHAR *	pszTitle						);

		BOOL	InitializeTray(		HWND	hWnd,
									HICON	hIcon,
									TCHAR *	pszToolTipMessage	);
		BOOL	UnInitializeTray(	VOID						);


	private	:

		HMODULE						m_hModule;
		UINT						m_nTrayMessageID;

		HWND						m_hTrayWnd;

		fpInstallHook				m_fpInstallHook;
		fpMouseHook					m_fpMouseHook;
		fpUnInstallHook				m_fpUnInstallHook;
		fpUnTrayAll					m_fpUnTrayAll;
		fpGetTrayMessageID			m_fpGetTrayMessageID;
		fpGetMinimizedWinodwList	m_fpGetMinimizedWinodwList;
		fpUnTrayMe					m_fpUnTrayMe;

		HMODULE						GetModuleHandle( VOID );
};
